package com.epam.action;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ResetCoockieAction implements Action {

	@Override
	public String perform(HttpServletRequest request,
			HttpServletResponse response) {
		Cookie[] cookies = request.getCookies();
		if (cookies != null) {
			for (Cookie ck : cookies) {
				ck.setMaxAge(0);
				ck.setValue("");
				response.addCookie(ck);
			}
		}
		return "/index.jsp";
	}

}
